gdk: Remove attributes_mask from gdk_window_new()
authorBenjamin Otte <otte@redhat.com>
Mon, 7 Nov 2016 00:33:43 +0000 (01:33 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 Nov 2016 00:33:43 +0000 (01:33 +0100)
The only remaining values were always treated as 0, so we just hardcode
them to 0.

17 files changed:
gdk/broadway/gdkprivate-broadway.h
gdk/broadway/gdkwindow-broadway.c
gdk/gdkdisplay.c
gdk/gdkdisplayprivate.h
gdk/gdkinternals.h
gdk/gdkwindow.c
gdk/mir/gdkmir-private.h
gdk/mir/gdkmirdisplay.c
gdk/mir/gdkmirscreen.c
gdk/mir/gdkmirwindowimpl.c
gdk/quartz/gdkprivate-quartz.h
gdk/quartz/gdkwindow-quartz.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkwindow-wayland.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkprivate-x11.h
gdk/x11/gdkwindow-x11.c

index 66e21b83adac6ad35c82039463bf592420edb902..c1af87c2f7b3994e8d0ae5b33bb65a30b1455f3e 100644 (file)
@@ -123,8 +123,7 @@ void       _gdk_broadway_display_create_window_impl     (GdkDisplay    *display,
                                                         GdkWindow     *real_parent,
                                                         GdkScreen     *screen,
                                                         GdkEventMask   event_mask,
-                                                        GdkWindowAttr *attributes,
-                                                        gint           attributes_mask);
+                                                        GdkWindowAttr *attributes);
 gboolean _gdk_broadway_display_set_selection_owner (GdkDisplay *display,
                                                    GdkWindow  *owner,
                                                    GdkAtom     selection,
index c3c9adfa642382eb8aa7e4eb2e4239131eecedf1..e54abd2a36612df29272883f8ade8faa94a0666e 100644 (file)
@@ -256,8 +256,7 @@ _gdk_broadway_display_create_window_impl (GdkDisplay    *display,
                                          GdkWindow     *real_parent,
                                          GdkScreen     *screen,
                                          GdkEventMask   event_mask,
-                                         GdkWindowAttr *attributes,
-                                         gint           attributes_mask)
+                                         GdkWindowAttr *attributes)
 {
   GdkWindowImplBroadway *impl;
   GdkBroadwayDisplay *broadway_display;
index b5ca4b9846a268ed55601893e07e8b1cb9576206..cf61a63367955c6b6f393d837cc6c093b5530894 100644 (file)
@@ -1931,16 +1931,14 @@ _gdk_display_create_window_impl (GdkDisplay       *display,
                                  GdkWindow        *real_parent,
                                  GdkScreen        *screen,
                                  GdkEventMask      event_mask,
-                                 GdkWindowAttr    *attributes,
-                                 gint              attributes_mask)
+                                 GdkWindowAttr    *attributes)
 {
   GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display,
                                                        window,
                                                        real_parent,
                                                        screen,
                                                        event_mask,
-                                                       attributes,
-                                                       attributes_mask);
+                                                       attributes);
 }
 
 GdkWindow *
index f22572189f7908cdc8702b5895d9896703f7656f..a9fce70e7674841fa622d938d72f52c823aecdae 100644 (file)
@@ -195,8 +195,7 @@ struct _GdkDisplayClass
                                                     GdkWindow     *real_parent,
                                                     GdkScreen     *screen,
                                                     GdkEventMask   event_mask,
-                                                    GdkWindowAttr *attributes,
-                                                    gint           attributes_mask);
+                                                    GdkWindowAttr *attributes);
 
   GdkKeymap *                (*get_keymap)         (GdkDisplay    *display);
   void                       (*push_error_trap)    (GdkDisplay    *display);
@@ -324,8 +323,7 @@ void                _gdk_display_create_window_impl   (GdkDisplay       *display
                                                        GdkWindow        *real_parent,
                                                        GdkScreen        *screen,
                                                        GdkEventMask      event_mask,
-                                                       GdkWindowAttr    *attributes,
-                                                       gint              attributes_mask);
+                                                       GdkWindowAttr    *attributes);
 GdkWindow *         _gdk_display_create_window        (GdkDisplay       *display);
 
 gboolean            gdk_display_make_gl_context_current  (GdkDisplay        *display,
index e29d97454dd147ab158f514a183c040bb56a6c98..9700627ccd96d64c4a9e0e3e006e525ef1c927ee 100644 (file)
@@ -87,12 +87,6 @@ typedef enum {
   GDK_GL_GLES                   = 1 << 6
 } GdkGLFlags;
 
-typedef enum
-{
-  GDK_WA_X        = 1 << 1,
-  GDK_WA_Y        = 1 << 2
-} GdkWindowAttributesType;
-
 extern GList            *_gdk_default_filters;
 extern GdkWindow        *_gdk_parent_root;
 
@@ -429,8 +423,7 @@ cairo_surface_t *
            _gdk_window_ref_cairo_surface (GdkWindow *window);
 
 GdkWindow* gdk_window_new                (GdkWindow      *parent,
-                                          GdkWindowAttr  *attributes,
-                                          gint            attributes_mask);
+                                          GdkWindowAttr  *attributes);
 void       _gdk_window_destroy           (GdkWindow      *window,
                                           gboolean        foreign_destroy);
 void       _gdk_window_clear_update_area (GdkWindow      *window);
index 0db6270f1f9afac2485644bb618668ca63d0957a..cdd38895cecb6b21f6b2ae7b220a88dcbe31a6a1 100644 (file)
@@ -1113,30 +1113,13 @@ sync_native_window_stack_position (GdkWindow *window)
     }
 }
 
-/**
- * gdk_window_new: (constructor)
- * @parent: (allow-none): a #GdkWindow, or %NULL to create the window as a child of
- *   the default root window for the default display.
- * @attributes: attributes of the new window
- * @attributes_mask: (type GdkWindowAttributesType): mask indicating which
- *   fields in @attributes are valid
- *
- * Creates a new #GdkWindow using the attributes from
- * @attributes. See #GdkWindowAttr and #GdkWindowAttributesType for
- * more details.  Note: to use this on displays other than the default
- * display, @parent must be specified.
- *
- * Returns: (transfer full): the new #GdkWindow
- **/
 GdkWindow*
 gdk_window_new (GdkWindow     *parent,
-               GdkWindowAttr *attributes,
-               gint           attributes_mask)
+               GdkWindowAttr *attributes)
 {
   GdkWindow *window;
   GdkScreen *screen;
   GdkDisplay *display;
-  int x, y;
   gboolean native;
   GdkEventMask event_mask;
   GdkWindow *real_parent;
@@ -1176,18 +1159,8 @@ gdk_window_new (GdkWindow     *parent,
   window->focus_on_map = TRUE;
   window->event_compression = TRUE;
 
-  if (attributes_mask & GDK_WA_X)
-    x = attributes->x;
-  else
-    x = 0;
-
-  if (attributes_mask & GDK_WA_Y)
-    y = attributes->y;
-  else
-    y = 0;
-
-  window->x = x;
-  window->y = y;
+  window->x = attributes->x;
+  window->y = attributes->y;
   window->width = (attributes->width > 1) ? (attributes->width) : (1);
   window->height = (attributes->height > 1) ? (attributes->height) : (1);
   window->alpha = 255;
@@ -1260,7 +1233,7 @@ gdk_window_new (GdkWindow     *parent,
       event_mask = get_native_event_mask (window);
 
       /* Create the impl */
-      _gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes, attributes_mask);
+      _gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes);
       window->impl_window = window;
 
       parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
@@ -1321,13 +1294,14 @@ gdk_window_new_toplevel (GdkDisplay *display,
 
   attr.event_mask = event_mask;
   attr.wclass = GDK_INPUT_OUTPUT;
+  attr.x = 0;
+  attr.y = 0;
   attr.width = width;
   attr.height = height;
   attr.window_type = GDK_WINDOW_TOPLEVEL;
 
   return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
-                         &attr,
-                         0);
+                         &attr);
 }
 
 /**
@@ -1362,8 +1336,7 @@ gdk_window_new_popup (GdkDisplay         *display,
   attr.window_type = GDK_WINDOW_TEMP;
 
   return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
-                         &attr,
-                         GDK_WA_X | GDK_WA_Y);
+                         &attr);
 }
 
 /**
@@ -1395,8 +1368,7 @@ gdk_window_new_temp (GdkDisplay *display)
   attr.window_type = GDK_WINDOW_TEMP;
 
   return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
-                         &attr,
-                         GDK_WA_X | GDK_WA_Y);
+                         &attr);
 }
 
 /**
@@ -1428,7 +1400,7 @@ gdk_window_new_child (GdkWindow          *parent,
   attr.height = position->height;
   attr.window_type = GDK_WINDOW_CHILD;
 
-  return gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
+  return gdk_window_new (parent, &attr);
 }
 
 /**
@@ -1460,7 +1432,7 @@ gdk_window_new_input (GdkWindow          *parent,
   attr.height = position->height;
   attr.window_type = GDK_WINDOW_CHILD;
 
-  return gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
+  return gdk_window_new (parent, &attr);
 }
 
 static gboolean
@@ -1777,7 +1749,7 @@ gdk_window_ensure_native (GdkWindow *window)
                                    window, parent,
                                    screen,
                                    get_native_event_mask (window),
-                                   NULL, 0);
+                                   NULL);
   new_impl = window->impl;
 
   parent->impl_window->native_children =
index 38f1d7a29dcb4b68c1da4b1c487246a653040b0b..69f927fab91c2b6d0afd1a1a3c34e9a8084d3345 100644 (file)
@@ -83,7 +83,7 @@ GdkCursor *_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name)
 
 const gchar *_gdk_mir_cursor_get_name (GdkCursor *cursor);
 
-GdkWindowImpl *_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr *attributes, gint attributes_mask);
+GdkWindowImpl *_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window);
 
 void _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState state);
 
index 0a44b7d1e5d52d6c3d66607d48bcc5b87c9f7964..c42962e389609f2806540a77fb14680db92fd1bf 100644 (file)
@@ -393,8 +393,7 @@ gdk_mir_display_create_window_impl (GdkDisplay    *display,
                                     GdkWindow     *real_parent,
                                     GdkScreen     *screen,
                                     GdkEventMask   event_mask,
-                                    GdkWindowAttr *attributes,
-                                    gint           attributes_mask)
+                                    GdkWindowAttr *attributes)
 {
   //g_printerr ("gdk_mir_display_create_window_impl");
   //g_printerr (" window=%p", window);
@@ -404,7 +403,7 @@ gdk_mir_display_create_window_impl (GdkDisplay    *display,
 
   if (attributes->wclass == GDK_INPUT_OUTPUT)
     {
-      window->impl = _gdk_mir_window_impl_new (display, window, attributes, attributes_mask);
+      window->impl = _gdk_mir_window_impl_new (display, window);
       window->impl_window = window;
     }
   else /* attributes->wclass == GDK_INPUT_ONLY */
index f9eea36cf69d02cfdc5cfbcf9d5b4f44097243a5..668da6073b037046b64dec9e2910761417cd1de1 100644 (file)
@@ -255,7 +255,7 @@ gdk_mir_screen_get_root_window (GdkScreen *screen)
   s->root_window->width = width;
   s->root_window->height = height;
   s->root_window->viewable = TRUE;
-  s->root_window->impl = _gdk_mir_window_impl_new (s->display, s->root_window, NULL, 0);
+  s->root_window->impl = _gdk_mir_window_impl_new (s->display, s->root_window);
 
   return s->root_window;
 }
index 3ed04669c7d91d8fae7d65c1bbee139aefff6e1a..ec76ac554c80dd45a6dcc8362a70a33b56679a61 100644 (file)
@@ -166,7 +166,7 @@ get_default_title (void)
 }
 
 GdkWindowImpl *
-_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr *attributes, gint attributes_mask)
+_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window)
 {
   GdkMirWindowImpl *impl = g_object_new (GDK_TYPE_MIR_WINDOW_IMPL, NULL);
 
index 05eace5553232d351e86e780a8cf0aae40dc8df6..7fcb2cbecaa054e891633a55e7b15cc8e8d4d9f7 100644 (file)
@@ -124,8 +124,7 @@ void       _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
                                                    GdkWindow     *real_parent,
                                                    GdkScreen     *screen,
                                                    GdkEventMask   event_mask,
-                                                   GdkWindowAttr *attributes,
-                                                   gint           attributes_mask);
+                                                   GdkWindowAttr *attributes);
 
 /* Display methods - keymap */
 GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);
index 27babc480e29d51dad542bf62a2bf14738031976..934953713597050630d9fe4bd1d62475564e811f 100644 (file)
@@ -774,8 +774,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
                                         GdkWindow     *real_parent,
                                         GdkScreen     *screen,
                                         GdkEventMask   event_mask,
-                                        GdkWindowAttr *attributes,
-                                        gint           attributes_mask)
+                                        GdkWindowAttr *attributes)
 {
   GdkWindowImplQuartz *impl;
   GdkWindowImplQuartz *parent_impl;
@@ -834,9 +833,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay    *display,
                                    window->width,
                                    window->height);
 
-        if (window->window_type == GDK_WINDOW_TEMP ||
-            ((attributes_mask & GDK_WA_TYPE_HINT) &&
-              attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
+        if (window->window_type == GDK_WINDOW_TEMP)
           {
             style_mask = NSBorderlessWindowMask;
           }
index a95c925ca138a41db249235a1f3e97c4a933d47b..481bea78cf86baa93ef8131d587bfa375fd94985 100644 (file)
@@ -137,8 +137,7 @@ void _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
                                              GdkWindow     *real_parent,
                                              GdkScreen     *screen,
                                              GdkEventMask   event_mask,
-                                             GdkWindowAttr *attributes,
-                                             gint           attributes_mask);
+                                             GdkWindowAttr *attributes);
 
 GdkWindow *_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
                                                 GdkAtom     selection);
index d8e1ec5efaf627d8d5e3da8f0565491410583ccc..e7fdd479a3037e7743486169326cd33918d185ba 100644 (file)
@@ -657,8 +657,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
                                          GdkWindow     *real_parent,
                                          GdkScreen     *screen,
                                          GdkEventMask   event_mask,
-                                         GdkWindowAttr *attributes,
-                                         gint           attributes_mask)
+                                         GdkWindowAttr *attributes)
 {
   GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
   GdkWindowImplWayland *impl;
@@ -3703,8 +3702,7 @@ gdk_wayland_window_new_subsurface (GdkDisplay         *display,
   attr.window_type = GDK_WINDOW_SUBSURFACE;
 
   return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
-                         &attr,
-                         GDK_WA_X | GDK_WA_Y);
+                         &attr);
 }
 
 /**
index 4b51e91322425814f4d7e87b529f6ed34e7cbed2..cddd9ef1b551ddb1f68088ecc74c7e9485d42034 100644 (file)
@@ -690,8 +690,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
                                       GdkWindow     *real_parent,
                                       GdkScreen     *screen,
                                       GdkEventMask   event_mask,
-                                      GdkWindowAttr *attributes,
-                                      gint           attributes_mask)
+                                      GdkWindowAttr *attributes)
 {
   HWND hwndNew;
   HANDLE hparent;
@@ -705,8 +704,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
   gint window_width, window_height;
   gint offset_x = 0, offset_y = 0;
   gint x, y, real_x = 0, real_y = 0;
-  /* check consistency of redundant information */
-  guint remaining_mask = attributes_mask;
 
   g_return_if_fail (display == _gdk_display);
 
@@ -719,22 +716,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
                     (attributes->wclass == GDK_INPUT_OUTPUT ? "" : "input-only"))
                           );
 
-  /* to ensure to not miss important information some additional check against
-   * attributes which may silently work on X11 */
-  if ((attributes_mask & GDK_WA_X) != 0)
-    {
-      g_assert (attributes->x == window->x);
-      remaining_mask &= ~GDK_WA_X;
-    }
-  if ((attributes_mask & GDK_WA_Y) != 0)
-    {
-      g_assert (attributes->y == window->y);
-      remaining_mask &= ~GDK_WA_Y;
-    }
-
-  if (remaining_mask != 0)
-    g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X", remaining_mask);
-
   hparent = GDK_WINDOW_HWND (real_parent);
 
   impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
index c1496e87a0914677ac7bdb8e38e391300285b201..15e1170c1edcebef59a7c8a92521d11d2fa3d60e 100644 (file)
@@ -272,8 +272,7 @@ void       _gdk_x11_display_create_window_impl     (GdkDisplay    *display,
                                                     GdkWindow     *real_parent,
                                                     GdkScreen     *screen,
                                                     GdkEventMask   event_mask,
-                                                    GdkWindowAttr *attributes,
-                                                    gint           attributes_mask);
+                                                    GdkWindowAttr *attributes);
 
 void _gdk_x11_precache_atoms (GdkDisplay          *display,
                               const gchar * const *atom_names,
index 371ba9e24682f852521b462a4c90d6d75aa9360a..b13e246420da6063ee12829facd309547c23db2f 100644 (file)
@@ -899,8 +899,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
                                      GdkWindow     *real_parent,
                                      GdkScreen     *screen,
                                      GdkEventMask   event_mask,
-                                     GdkWindowAttr *attributes,
-                                     gint           attributes_mask)
+                                     GdkWindowAttr *attributes)
 {
   GdkWindowImplX11 *impl;
   GdkX11Screen *x11_screen;